/*
 * Copyright (c) Hunan Goke,Chengdu Goke,Shandong Goke. 2021. All rights reserved.
 */

#ifndef __SC500AI_CMOS_EX_H_
#define __SC500AI_CMOS_EX_H_

#include "awb_comm.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

static const ISP_CMOS_LCAC_S g_stIspLCac = {

    /* bEnable */
    1,
    /* u16PurpleDetRange */
    30,
    /* VarThr */
    0,
    /* au16RLumaThd */
    {1500, 1500, 0},
    /* au16GLumaThd */
    {1500, 1500, 0},
    /* au16BLumaThd */
    {4095, 1500, 0},
    /* au16YLumaThd */
    {3200, 1500, 0},
    /* as16CbCrRatio */
    {-50, -50, -50},
    /* enOpMode */
    0,
    {
        /* u8DePurpleCrStr */
        0,
        /* u8DePurpleCbStr */
        3
    },
    {
        /* u8DePurpleCrStr */
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
        /* u8DePurpleCbStr */
        { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }
    }
};

static const ISP_CMOS_DPC_S g_stCmosDpc = {
    /* ISO */
    /* 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400, 204800, 409600, 819200, 1638400, 3276800 */
    { 120, 130, 160, 210, 230, 240, 245, 248, 248, 240, 152, 152, 152, 152, 152, 152 }, /* Strength */
    { 0, 16, 24, 32, 32, 34, 36, 36, 36, 40, 50, 50, 50, 50, 50, 50 },                /* BlendRatio */
    0, /* 0 for after drc, 1 for before wdr */
};

static const ISP_CMOS_GE_S g_stIspGe = {
    /* For GE */
    1,    /* bEnable */
    13,   /* u8Slope */
    13,   /* u8SensiSlope */
    4800, /* u16SensiThr */
    /* ISO */
    /*   1,    2,      4,     8,    16,    32,    64,   128,   256,   512,  1024,  2048,  4096,  8192, 16384, 32768 */
    { 4800, 4800, 4800, 4800, 4960, 4960, 4960, 4960, 5120, 5120, 5120, 5120, 5280, 5280, 5280, 5280 }, /* Threshold */
    { 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 131 },                 /* Strength */
    {16384, 16384, 16384, 16384, 16384, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768,
     32768, 32768} /* NpOffset */
};

static const ISP_CMOS_DEMOSAIC_S g_stIspDemosaic = {
    1, /* bEnable */
    /* au8NonDirStr */
    /* 1,    2,    4,    8,   16,   32,   64,   128,   256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
    /* au8NonDirLFDetailEhc */
    { 32, 32, 32, 36, 36, 36, 32, 22, 20, 18, 18, 18, 18, 18, 18, 18 },
    /* au8NonDirHFDetailEhc */
    { 3, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 },
    /* au8DetailSmoothRange */
    { 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 7, 7, 7, 7, 7, 7 },
};

static const ISP_CMOS_ANTIFALSECOLOR_S g_stIspAntiFalseColor = {
    1, /* bEnable */
    /* 1,    2,    4,    8,   16,   32,   64,   128,   256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 25, 22, 20, 22, 22, 22, 20, 20, 18,  6,  5,  4,  3,  2,  1,  0}, /* au8AntiFalseColorThreshold */
    { 22, 24, 20, 20, 22, 25, 25, 22, 16,  6,  5,  4,  3,  2,  1,  0}, /* au8AntiFalseColorStrength */
};

/* BAYER NR */
static ISP_CMOS_NOISE_CALIBRATION_S g_stIspNoiseCalibratio = {
    10, /* Calibration Lut Num */
    /* ************Calibration LUT Table************ */
    {
        { 100.000000f, 0.025472f, 0.008370f },
        { 200.000000f, 0.051026f, 0.020051f },
        { 400.000000f, 0.100380f, 0.002657f },
        { 800.000000f, 0.199705f, 0.024892f },
        { 1600.000000f, 0.397814f, 0.118102f },
        { 3200.000000f, 0.792300f, 0.443096f },
        { 6400.000000f, 1.554968f, 2.329596f },
        { 12800.000000f, 3.029946f, 11.217048f },
        { 25600.000000f, 5.870243f, 45.309135f },
        { 51200.000000f, 10.794330f, 187.701797f }
    }
    /*********************************************/
};

static const ISP_CMOS_BAYERNR_S g_stIspBayerNr = {
    1,                                                                  /* bEnable */
    0,                                                                  /* bBnrMonoSensorEn */
    0,                                                                  /* bNrLscEnable */
    96,                                                                 /* u8BnrLscMaxGain */
    256,                                                                /* u16BnrLscCmpStrength */
    { 64, 72, 75, 80, 90, 90, 80, 70, 60, 50, 50, 50, 50, 50, 40, 40}, // FineStr
    {
        { 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, /* ChromaStrR */
        { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, /* ChromaStrGr */
        { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, /* ChromaStrGb */
        { 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }  /* ChromaStrB */
    },
    { 0, 0, 0, 0 }, /* WDRFrameStr */
    { 0, 0, 0, 0 }, /* FusionFrameStr */
    {
        { 90, 100, 100, 110, 110, 120, 130, 150, 160, 170, 170, 170, 170, 170, 170, 170 }, /* CoarseStrR */
        { 90, 100, 100, 110, 110, 120, 130, 150, 160, 170, 170, 170, 170, 170, 170, 170 }, /* CoarseStrGR */
        { 90, 100, 100, 110, 110, 120, 130, 150, 160, 170, 170, 170, 170, 170, 170, 170 }, /* CoarseStrGB */
        { 90, 100, 100, 110, 110, 120, 130, 150, 160, 170, 170, 170, 170, 170, 170, 170 }  /* CoarseStrB */
    },
    { 20, 20, 18, 16, 14, 12, 12, 12, 12, 10, 10, 10, 10, 10, 10, 10}, // lutCoringWeight
    {
        90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,  90,  90,  90,  90,
        90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 100, 100, 100, 100, 100, 100, 100
    }, /* CoringRatio */
};

static const ISP_CMOS_LDCI_S g_stIspLdci = {
    /* bEnable */
    1,
    /* u8GaussLPFSigma */
    28,

    /* 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 */
    /* au8HePosWgt */
    { 20, 20, 30, 32, 36, 30, 30, 20, 10, 0, 0, 0, 0, 0, 0, 0 },

    /* au8HePosSigma */
    { 64, 64, 64, 48, 40, 24, 24, 20, 12, 8, 6, 2, 1, 1, 1, 1 },

    /* au8HePosMean */
    { 32, 32, 32, 32, 30, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 },

    /* au8HeNegWgt */
    { 50, 45, 45, 45, 50, 40, 40, 30, 20, 0, 0, 0, 0, 0, 0, 0 },

    /* au8HeNegSigma */
    { 80, 80, 80, 80, 80, 64, 54, 48, 36, 8, 6, 2, 1, 1, 1, 1 },

    /* au8HeNegMean */
    { 128, 108, 90, 80, 80, 70, 70, 70, 60, 60, 0, 0, 0, 0, 0, 0 },

    /* au16BlcCtrl */
    { 20, 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }
};

static const ISP_CMOS_LDCI_S g_stIspLdciIr = {
    /* bEnable */
    1,
    /* u8GaussLPFSigma */
    28,

    /* 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 */
    /* au8HePosWgt */
    { 64, 64, 56, 36, 30, 24, 24, 24, 30, 0, 0, 0, 0, 0, 0, 0 },

    /* au8HePosSigma */
    { 120, 120, 110, 100, 80, 64, 56, 48, 20, 8, 6, 2, 1, 1, 1, 1 },

    /* au8HePosMean */
    { 32, 32, 32, 32, 32, 30, 26, 24, 20, 0, 0, 0, 0, 0, 0, 0 },

    /* au8HeNegWgt */
    { 72, 72, 72, 72, 72, 72, 64, 56, 40, 0, 0, 0, 0, 0, 0, 0 },

    /* au8HeNegSigma */
    { 120, 120, 110, 100, 100, 90, 80, 64, 64, 8, 6, 2, 1, 1, 1, 1 },

    /* au8HeNegMean */
    { 180, 180, 180, 160, 140, 120, 100, 100, 60, 0, 0, 0, 0, 0, 0, 0 },

    /* au16BlcCtrl */
    { 16, 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }
};

static const ISP_CMOS_GAMMA_S g_stIspGamma = {
    /* au16Gamma[GAMMA_EXT_NODE_NUMBER] */
    { 0,    5,    11,   17,   24,   30,   37,   45,   52,   60,   68,   77,   85,   94,   103,  112,  122,  132,  142,
      152,  162,  172,  183,  194,  205,  216,  227,  238,  250,  262,  273,  285,  297,  309,  321,  333,  345,  357,
      369,  382,  394,  406,  419,  431,  443,  455,  468,  480,  492,  504,  516,  528,  540,  552,  564,  575,  587,
      598,  610,  621,  632,  643,  653,  664,  674,  684,  695,  705,  715,  726,  736,  746,  757,  767,  778,  788,
      798,  809,  819,  830,  840,  850,  861,  871,  882,  892,  902,  913,  923,  933,  944,  954,  964,  975,  985,
      995,  1005, 1016, 1026, 1036, 1046, 1056, 1067, 1077, 1087, 1097, 1107, 1117, 1127, 1137, 1147, 1157, 1167, 1176,
      1186, 1196, 1206, 1216, 1225, 1235, 1245, 1254, 1264, 1273, 1283, 1292, 1301, 1311, 1320, 1329, 1338, 1348, 1357,
      1366, 1375, 1384, 1393, 1402, 1412, 1421, 1430, 1439, 1447, 1456, 1465, 1474, 1483, 1492, 1501, 1509, 1518, 1527,
      1536, 1544, 1553, 1562, 1570, 1579, 1587, 1596, 1604, 1613, 1621, 1630, 1638, 1646, 1655, 1663, 1671, 1679, 1688,
      1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1783, 1791, 1799, 1807, 1814, 1822, 1830, 1837,
      1845, 1852, 1860, 1867, 1874, 1882, 1889, 1896, 1904, 1911, 1918, 1925, 1932, 1939, 1946, 1953, 1960, 1967, 1974,
      1981, 1988, 1995, 2001, 2008, 2015, 2021, 2028, 2035, 2041, 2048, 2054, 2061, 2067, 2074, 2080, 2087, 2093, 2099,
      2106, 2112, 2118, 2124, 2131, 2137, 2143, 2149, 2155, 2161, 2167, 2174, 2180, 2186, 2192, 2198, 2204, 2210, 2215,
      2221, 2227, 2233, 2239, 2245, 2251, 2257, 2262, 2268, 2274, 2280, 2286, 2291, 2297, 2303, 2308, 2314, 2319, 2325,
      2330, 2336, 2341, 2347, 2352, 2357, 2363, 2368, 2373, 2379, 2384, 2389, 2394, 2400, 2405, 2410, 2415, 2420, 2425,
      2430, 2435, 2440, 2445, 2450, 2455, 2460, 2465, 2470, 2475, 2480, 2485, 2490, 2495, 2500, 2504, 2509, 2514, 2519,
      2524, 2529, 2533, 2538, 2543, 2548, 2553, 2557, 2562, 2567, 2572, 2576, 2581, 2586, 2591, 2595, 2600, 2605, 2609,
      2614, 2619, 2624, 2628, 2633, 2638, 2642, 2647, 2652, 2656, 2661, 2666, 2670, 2675, 2679, 2684, 2689, 2693, 2698,
      2702, 2707, 2711, 2716, 2720, 2725, 2729, 2734, 2738, 2743, 2747, 2751, 2756, 2760, 2764, 2769, 2773, 2777, 2782,
      2786, 2790, 2795, 2799, 2803, 2807, 2811, 2816, 2820, 2824, 2828, 2832, 2836, 2840, 2844, 2848, 2852, 2856, 2860,
      2864, 2868, 2872, 2876, 2880, 2884, 2888, 2892, 2896, 2900, 2903, 2907, 2911, 2915, 2919, 2922, 2926, 2930, 2934,
      2937, 2941, 2944, 2948, 2952, 2955, 2959, 2962, 2966, 2969, 2973, 2976, 2980, 2983, 2986, 2990, 2993, 2996, 3000,
      3003, 3006, 3010, 3013, 3016, 3019, 3023, 3026, 3029, 3032, 3035, 3038, 3041, 3045, 3048, 3051, 3054, 3057, 3060,
      3063, 3066, 3069, 3072, 3075, 3078, 3081, 3084, 3087, 3090, 3092, 3095, 3098, 3101, 3104, 3107, 3110, 3112, 3115,
      3118, 3121, 3124, 3127, 3129, 3132, 3135, 3138, 3140, 3143, 3146, 3149, 3151, 3154, 3157, 3160, 3162, 3165, 3168,
      3170, 3173, 3176, 3178, 3181, 3184, 3186, 3189, 3192, 3194, 3197, 3200, 3202, 3205, 3208, 3210, 3213, 3216, 3218,
      3221, 3224, 3226, 3229, 3231, 3234, 3237, 3239, 3242, 3245, 3247, 3250, 3253, 3255, 3258, 3261, 3263, 3266, 3269,
      3271, 3274, 3277, 3279, 3282, 3285, 3287, 3290, 3293, 3295, 3298, 3300, 3303, 3306, 3308, 3311, 3313, 3316, 3318,
      3321, 3324, 3326, 3329, 3331, 3334, 3336, 3339, 3341, 3344, 3346, 3349, 3351, 3354, 3356, 3359, 3361, 3364, 3366,
      3369, 3371, 3373, 3376, 3378, 3381, 3383, 3385, 3388, 3390, 3393, 3395, 3397, 3400, 3402, 3405, 3407, 3409, 3412,
      3414, 3416, 3419, 3421, 3423, 3426, 3428, 3430, 3433, 3435, 3437, 3439, 3442, 3444, 3446, 3448, 3451, 3453, 3455,
      3457, 3460, 3462, 3464, 3466, 3469, 3471, 3473, 3475, 3477, 3480, 3482, 3484, 3486, 3488, 3490, 3493, 3495, 3497,
      3499, 3501, 3503, 3505, 3508, 3510, 3512, 3514, 3516, 3518, 3520, 3522, 3524, 3526, 3528, 3531, 3533, 3535, 3537,
      3539, 3541, 3543, 3545, 3547, 3549, 3551, 3553, 3555, 3557, 3559, 3561, 3563, 3565, 3567, 3569, 3571, 3573, 3575,
      3577, 3579, 3581, 3583, 3584, 3586, 3588, 3590, 3592, 3594, 3596, 3598, 3600, 3601, 3603, 3605, 3607, 3609, 3611,
      3612, 3614, 3616, 3618, 3620, 3621, 3623, 3625, 3627, 3628, 3630, 3632, 3634, 3635, 3637, 3639, 3641, 3642, 3644,
      3646, 3647, 3649, 3651, 3652, 3654, 3656, 3657, 3659, 3661, 3662, 3664, 3666, 3667, 3669, 3671, 3672, 3674, 3675,
      3677, 3679, 3680, 3682, 3684, 3685, 3687, 3688, 3690, 3691, 3693, 3695, 3696, 3698, 3699, 3701, 3702, 3704, 3706,
      3707, 3709, 3710, 3712, 3713, 3715, 3716, 3718, 3720, 3721, 3723, 3724, 3726, 3727, 3729, 3730, 3732, 3733, 3735,
      3736, 3738, 3739, 3741, 3742, 3744, 3745, 3747, 3748, 3750, 3751, 3753, 3754, 3756, 3757, 3759, 3760, 3762, 3763,
      3765, 3766, 3768, 3769, 3771, 3772, 3774, 3775, 3777, 3779, 3780, 3782, 3783, 3785, 3786, 3787, 3789, 3790, 3792,
      3793, 3795, 3796, 3798, 3799, 3801, 3802, 3804, 3805, 3807, 3808, 3809, 3811, 3812, 3814, 3815, 3817, 3818, 3819,
      3821, 3822, 3824, 3825, 3827, 3828, 3829, 3831, 3832, 3834, 3835, 3836, 3838, 3839, 3840, 3842, 3843, 3845, 3846,
      3847, 3849, 3850, 3851, 3853, 3854, 3856, 3857, 3858, 3860, 3861, 3862, 3864, 3865, 3866, 3868, 3869, 3870, 3872,
      3873, 3874, 3876, 3877, 3878, 3880, 3881, 3882, 3884, 3885, 3886, 3888, 3889, 3890, 3892, 3893, 3894, 3895, 3897,
      3898, 3899, 3901, 3902, 3903, 3904, 3906, 3907, 3908, 3910, 3911, 3912, 3913, 3915, 3916, 3917, 3919, 3920, 3921,
      3922, 3924, 3925, 3926, 3927, 3929, 3930, 3931, 3933, 3934, 3935, 3936, 3938, 3939, 3940, 3941, 3943, 3944, 3945,
      3946, 3948, 3949, 3950, 3951, 3952, 3954, 3955, 3956, 3957, 3959, 3960, 3961, 3962, 3963, 3965, 3966, 3967, 3968,
      3969, 3971, 3972, 3973, 3974, 3975, 3977, 3978, 3979, 3980, 3981, 3982, 3984, 3985, 3986, 3987, 3988, 3989, 3991,
      3992, 3993, 3994, 3995, 3996, 3997, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4008, 4009, 4010, 4011, 4012,
      4013, 4014, 4015, 4016, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 4028, 4029, 4030, 4031, 4032, 4033,
      4034, 4035, 4036, 4037, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, 4050, 4051, 4052, 4053, 4054,
      4055, 4056, 4057, 4058, 4059, 4061, 4062, 4063, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4072, 4073, 4074, 4075,
      4076, 4077, 4078, 4079, 4080, 4082, 4083, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4092, 4093, 4094, 4095}
};

static const ISP_CMOS_GAMMA_S g_stIspGammaIr = {
    /* au16Gamma[GAMMA_EXT_NODE_NUMBER] */
    { 0,    6,    13,   19,   27,   34,   42,   50,   59,   68,   77,   87,   96,   107,  117,  128,  138,  150,  161,
      172,  184,  196,  208,  221,  233,  246,  259,  272,  285,  298,  311,  324,  338,  351,  365,  379,  392,  406,
      420,  433,  447,  461,  475,  488,  502,  515,  529,  542,  556,  569,  582,  595,  608,  621,  633,  646,  658,
      670,  682,  694,  706,  717,  728,  739,  749,  760,  770,  781,  791,  801,  811,  822,  832,  842,  852,  862,
      872,  882,  892,  902,  911,  921,  931,  940,  950,  960,  969,  979,  988,  998,  1007, 1017, 1026, 1035, 1045,
      1054, 1063, 1072, 1081, 1090, 1099, 1108, 1117, 1126, 1135, 1144, 1153, 1162, 1170, 1179, 1188, 1197, 1205, 1214,
      1222, 1231, 1239, 1248, 1256, 1265, 1273, 1281, 1290, 1298, 1306, 1315, 1323, 1331, 1339, 1347, 1355, 1363, 1371,
      1379, 1387, 1394, 1402, 1410, 1417, 1425, 1432, 1440, 1447, 1454, 1462, 1469, 1476, 1483, 1490, 1497, 1505, 1512,
      1519, 1526, 1532, 1539, 1546, 1553, 1560, 1567, 1574, 1580, 1587, 1594, 1601, 1607, 1614, 1621, 1627, 1634, 1641,
      1647, 1654, 1661, 1667, 1674, 1681, 1687, 1694, 1701, 1707, 1714, 1721, 1728, 1734, 1741, 1748, 1755, 1761, 1768,
      1775, 1782, 1789, 1796, 1804, 1811, 1818, 1826, 1833, 1840, 1848, 1855, 1862, 1870, 1877, 1884, 1892, 1899, 1906,
      1914, 1921, 1928, 1935, 1942, 1950, 1957, 1964, 1971, 1978, 1985, 1992, 1999, 2006, 2013, 2020, 2027, 2034, 2041,
      2048, 2055, 2061, 2068, 2075, 2082, 2088, 2095, 2102, 2108, 2115, 2121, 2128, 2134, 2141, 2147, 2153, 2160, 2166,
      2172, 2178, 2184, 2190, 2196, 2202, 2208, 2214, 2220, 2226, 2232, 2238, 2243, 2249, 2255, 2260, 2266, 2272, 2277,
      2283, 2288, 2294, 2299, 2305, 2310, 2316, 2321, 2327, 2332, 2338, 2343, 2348, 2354, 2359, 2364, 2369, 2375, 2380,
      2385, 2390, 2395, 2401, 2406, 2411, 2416, 2421, 2426, 2431, 2436, 2441, 2446, 2451, 2456, 2461, 2466, 2471, 2475,
      2480, 2485, 2490, 2495, 2500, 2504, 2509, 2514, 2519, 2523, 2528, 2533, 2537, 2542, 2547, 2551, 2556, 2560, 2565,
      2569, 2574, 2578, 2583, 2587, 2592, 2596, 2601, 2605, 2610, 2614, 2618, 2623, 2627, 2632, 2636, 2640, 2645, 2649,
      2653, 2657, 2662, 2666, 2670, 2674, 2679, 2683, 2687, 2691, 2695, 2699, 2704, 2708, 2712, 2716, 2720, 2724, 2728,
      2732, 2736, 2740, 2744, 2748, 2752, 2756, 2760, 2764, 2768, 2772, 2776, 2780, 2784, 2788, 2792, 2796, 2800, 2804,
      2808, 2811, 2815, 2819, 2823, 2827, 2831, 2835, 2838, 2842, 2846, 2850, 2853, 2857, 2861, 2864, 2868, 2871, 2875,
      2879, 2882, 2886, 2889, 2893, 2896, 2900, 2903, 2907, 2910, 2913, 2917, 2920, 2924, 2927, 2930, 2934, 2937, 2940,
      2943, 2947, 2950, 2953, 2956, 2960, 2963, 2966, 2969, 2972, 2975, 2979, 2982, 2985, 2988, 2991, 2994, 2997, 3000,
      3003, 3006, 3009, 3012, 3015, 3018, 3021, 3024, 3027, 3030, 3033, 3036, 3039, 3042, 3044, 3047, 3050, 3053, 3056,
      3059, 3062, 3064, 3067, 3070, 3073, 3076, 3078, 3081, 3084, 3087, 3090, 3092, 3095, 3098, 3101, 3103, 3106, 3109,
      3111, 3114, 3117, 3120, 3122, 3125, 3128, 3130, 3133, 3136, 3138, 3141, 3144, 3146, 3149, 3152, 3154, 3157, 3160,
      3162, 3165, 3168, 3170, 3173, 3176, 3178, 3181, 3184, 3186, 3189, 3192, 3194, 3197, 3199, 3202, 3205, 3207, 3210,
      3213, 3215, 3218, 3221, 3223, 3226, 3228, 3231, 3233, 3236, 3239, 3241, 3244, 3246, 3249, 3251, 3254, 3256, 3259,
      3261, 3264, 3266, 3269, 3271, 3274, 3276, 3278, 3281, 3283, 3286, 3288, 3291, 3293, 3295, 3298, 3300, 3302, 3305,
      3307, 3310, 3312, 3314, 3317, 3319, 3321, 3324, 3326, 3328, 3330, 3333, 3335, 3337, 3340, 3342, 3344, 3346, 3349,
      3351, 3353, 3355, 3358, 3360, 3362, 3364, 3367, 3369, 3371, 3373, 3375, 3378, 3380, 3382, 3384, 3386, 3389, 3391,
      3393, 3395, 3397, 3399, 3402, 3404, 3406, 3408, 3410, 3412, 3414, 3417, 3419, 3421, 3423, 3425, 3427, 3429, 3431,
      3433, 3436, 3438, 3440, 3442, 3444, 3446, 3448, 3450, 3452, 3454, 3457, 3459, 3461, 3463, 3465, 3467, 3469, 3471,
      3473, 3475, 3477, 3479, 3481, 3484, 3486, 3488, 3490, 3492, 3494, 3496, 3498, 3500, 3502, 3504, 3506, 3508, 3510,
      3512, 3514, 3516, 3518, 3520, 3522, 3524, 3526, 3528, 3530, 3532, 3534, 3536, 3538, 3540, 3542, 3544, 3546, 3548,
      3550, 3552, 3554, 3556, 3558, 3560, 3562, 3564, 3566, 3568, 3570, 3572, 3574, 3576, 3578, 3580, 3581, 3583, 3585,
      3587, 3589, 3591, 3593, 3595, 3597, 3599, 3600, 3602, 3604, 3606, 3608, 3610, 3612, 3614, 3615, 3617, 3619, 3621,
      3623, 3625, 3627, 3628, 3630, 3632, 3634, 3636, 3638, 3639, 3641, 3643, 3645, 3647, 3648, 3650, 3652, 3654, 3656,
      3657, 3659, 3661, 3663, 3665, 3666, 3668, 3670, 3672, 3673, 3675, 3677, 3679, 3680, 3682, 3684, 3686, 3687, 3689,
      3691, 3693, 3694, 3696, 3698, 3700, 3701, 3703, 3705, 3706, 3708, 3710, 3712, 3713, 3715, 3717, 3718, 3720, 3722,
      3723, 3725, 3727, 3729, 3730, 3732, 3734, 3735, 3737, 3739, 3740, 3742, 3743, 3745, 3747, 3748, 3750, 3752, 3753,
      3755, 3757, 3758, 3760, 3761, 3763, 3765, 3766, 3768, 3769, 3771, 3772, 3774, 3776, 3777, 3779, 3780, 3782, 3783,
      3785, 3786, 3788, 3790, 3791, 3793, 3794, 3796, 3797, 3799, 3800, 3802, 3803, 3805, 3806, 3808, 3809, 3811, 3812,
      3814, 3815, 3817, 3818, 3820, 3821, 3823, 3824, 3825, 3827, 3828, 3830, 3831, 3833, 3834, 3836, 3837, 3839, 3840,
      3841, 3843, 3844, 3846, 3847, 3849, 3850, 3852, 3853, 3854, 3856, 3857, 3859, 3860, 3861, 3863, 3864, 3866, 3867,
      3869, 3870, 3871, 3873, 3874, 3876, 3877, 3878, 3880, 3881, 3883, 3884, 3885, 3887, 3888, 3890, 3891, 3892, 3894,
      3895, 3897, 3898, 3899, 3901, 3902, 3904, 3905, 3906, 3908, 3909, 3911, 3912, 3913, 3915, 3916, 3918, 3919, 3920,
      3922, 3923, 3925, 3926, 3927, 3929, 3930, 3932, 3933, 3934, 3936, 3937, 3938, 3940, 3941, 3943, 3944, 3945, 3947,
      3948, 3949, 3951, 3952, 3954, 3955, 3956, 3958, 3959, 3960, 3962, 3963, 3964, 3966, 3967, 3968, 3970, 3971, 3972,
      3974, 3975, 3976, 3978, 3979, 3980, 3982, 3983, 3984, 3986, 3987, 3988, 3990, 3991, 3992, 3993, 3995, 3996, 3997,
      3999, 4000, 4001, 4003, 4004, 4005, 4007, 4008, 4009, 4010, 4012, 4013, 4014, 4016, 4017, 4018, 4020, 4021, 4022,
      4023, 4025, 4026, 4027, 4029, 4030, 4031, 4033, 4034, 4035, 4036, 4038, 4039, 4040, 4042, 4043, 4044, 4045, 4047,
      4048, 4049, 4051, 4052, 4053, 4055, 4056, 4057, 4058, 4060, 4061, 4062, 4064, 4065, 4066, 4068, 4069, 4070, 4071,
      4073, 4074, 4075, 4077, 4078, 4079, 4081, 4082, 4083, 4084, 4086, 4087, 4088, 4090, 4091, 4092, 4094, 4095}
};

static const ISP_CMOS_PREGAMMA_S g_stPreGamma = {
    0,
    { 3821,   7131,    9741,    11691,   13307,  14713,  15971,  17118,  18179,  20099,  21818,  23385,  24833,  26185,
      27456,  28659,   29804,   30897,   31945,  32952,  33923,  35770,  37506,  39150,  40713,  42207,  43638,  45014,
      46340,  47622,   48863,   50066,   51235,  52373,  53481,  54561,  55616,  57656,  59611,  61491,  63303,  65054,
      66749,  68393,   69990,   71543,   73057,  74533,  75974,  77383,  78761,  80110,  81432,  83999,  86475,  88866,
      91182,  93428,   95609,   97731,   99799,  101815, 103784, 105708, 107590, 109433, 111239, 113010, 114747, 118128,
      121395, 124558,  127626,  130606,  133505, 136330, 139084, 141773, 144402, 146973, 149491, 151957, 154376, 156749,
      159079, 161368,  163618,  165831,  168008, 170152, 172263, 174342, 176392, 178413, 180407, 182374, 184315, 186232,
      188125, 189995,  191842,  193668,  197259, 200771, 204210, 207580, 210884, 214126, 217308, 220435, 223509, 226532,
      229506, 232434,  235318,  238159,  240959, 243720, 246443, 249130, 251782, 254400, 256986, 259540, 262064, 264559,
      267025, 269464,  271876,  274262,  276623, 278960, 281273, 283562, 288076, 292504, 296852, 301124, 305323, 309452,
      313515, 317515,  321454,  325335,  329160, 332931, 336651, 340322, 343945, 347521, 351054, 354543, 357991, 361399,
      364767, 368099,  371394,  374653,  377878, 381070, 384230, 387358, 390456, 393523, 396562, 399573, 405512, 411348,
      417083, 422724,  428274,  433738,  439119, 444420, 449646, 454798, 459880, 464894, 469842, 474728, 479554, 484320,
      489030, 493685,  498287,  502838,  507339, 511791, 516197, 520557, 524874, 529147, 533378, 537569, 541720, 545833,
      549908, 553946,  557949,  561917,  565852, 569753, 577458, 585040, 592504, 599854, 607096, 614234, 621272, 628214,
      635064, 641824,  648498,  655090,  661601, 668035, 674394, 680681, 686897, 693045, 699128, 705146, 711103, 716999,
      722836, 728616,  734341,  740012,  745630, 751197, 756713, 762181, 767602, 778305, 788831, 799189, 809384, 819425,
      829318, 839069,  848683,  858166,  867523, 876757, 885875, 894879, 903774, 912563, 921249, 938329, 955037, 971395,
      987423, 1003139, 1018560, 1033701, 1048575 }
};

static const ISP_CMOS_SHARPEN_S g_stIspYuvSharpen = {
    /* u8SkinUmin */
    110,
    /* u8SkinVmin */
    128,
    /* u8SkinUmax */
    128,
    /* u8SkinVmax */
    149,

    /* Manual Para */
    {
        /* au8LumaWgt */
        {31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
         31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31},
        /* u16TextureStr */
        {420, 420, 390, 390, 390, 390, 390, 370, 350, 330, 310, 290, 270, 270, 270, 270,
         270, 270, 266, 260, 244, 230, 230, 230, 230, 230, 230, 210, 190, 190, 170, 150},
        /* u16EdgeStr */
        {120, 123, 125, 128, 130, 135, 140, 148, 160, 168, 180, 190, 200, 210, 210, 210,
         210, 210, 200, 190, 185, 175, 165, 160, 146, 136, 130, 128, 125, 123, 120, 120},
        /* u16TextureFreq */
        160,
        /* u16EdgeFreq */
        100,
        /* u8OverShoot */
        55,
        /* u8UnderShoot */
        70,
        /* u8shootSupStr */
        10,
        /* u8shootSupAdj */
        9,
        /* u8DetailCtrl */
        128,
        /* u8DetailCtrlThr */
        180,
        /* u8EdgeFiltStr */
        60,
        /* u8EdgeFiltMaxCap */
        18,
        /* u8RGain */
        28,
        /* u8GGain */
        32,
        /* u8BGain */
        31,
        /* u8SkinGain */
        23,
        /* u8MaxSharpGain */
        67,
        /* u8WeakDetailGain */
        0

    },
    /* Auto Para */
    {
        /* au16LumaWgt */
        /* ISO */
        /* 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400, 204800, 409600, 819200,1638400,3276800 */
        {   {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },
            {   31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 }
        },
        /* au16TextureStr  */
        /* ISO */
        /* 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400, 204800, 409600, 819200,1638400,3276800 */
        {   {  272, 217, 173, 181, 151, 150, 128, 128, 128, 128, 128, 128, 128,  28,  28,  28 },
            {  278, 228, 186, 189, 162, 157, 138, 140, 148, 148, 148, 148, 148,  43,  43,  43 },
            {  284, 240, 200, 199, 173, 164, 150, 153, 177, 177, 177, 177, 177,  59,  59,  59 },
            {  291, 252, 214, 208, 185, 171, 161, 165, 211, 211, 211, 211, 211,  75,  75,  75 },
            {  297, 263, 228, 217, 196, 178, 173, 178, 247, 247, 247, 247, 247,  91,  91,  91 },
            {  302, 273, 240, 225, 206, 184, 183, 189, 281, 281, 281, 281, 281, 106, 106, 106 },
            {  307, 282, 250, 232, 215, 189, 191, 199, 310, 310, 310, 310, 310, 121, 121, 121 },
            {  309, 287, 257, 237, 221, 192, 196, 207, 331, 331, 331, 331, 331, 136, 136, 136 },
            {  309, 289, 259, 240, 224, 192, 198, 212, 342, 342, 342, 342, 342, 152, 152, 152 },
            {  308, 288, 259, 241, 226, 191, 198, 215, 348, 348, 348, 348, 348, 167, 167, 167 },
            {  306, 286, 256, 241, 226, 188, 196, 217, 351, 351, 351, 351, 351, 183, 183, 183 },
            {  303, 282, 252, 240, 225, 185, 193, 218, 352, 352, 352, 352, 352, 199, 199, 199 },
            {  300, 278, 248, 239, 224, 181, 189, 218, 350, 350, 350, 350, 350, 214, 214, 214 },
            {  296, 274, 243, 238, 222, 178, 186, 218, 347, 347, 347, 347, 347, 228, 228, 228 },
            {  294, 270, 240, 237, 221, 175, 184, 217, 344, 344, 344, 344, 344, 241, 241, 241 },
            {  292, 268, 239, 236, 220, 175, 183, 217, 341, 341, 341, 341, 341, 254, 254, 254 },
            {  291, 267, 239, 236, 220, 176, 183, 217, 338, 338, 338, 338, 338, 267, 267, 267 },
            {  291, 267, 242, 237, 220, 178, 185, 217, 333, 333, 333, 333, 333, 283, 283, 283 },
            {  292, 268, 245, 237, 221, 182, 188, 217, 327, 327, 327, 327, 327, 298, 298, 298 },
            {  293, 268, 249, 238, 222, 186, 191, 216, 320, 320, 320, 320, 320, 313, 313, 313 },
            {  294, 269, 252, 238, 222, 190, 194, 215, 313, 313, 313, 313, 313, 325, 325, 325 },
            {  293, 269, 254, 238, 221, 193, 196, 213, 305, 305, 305, 305, 305, 338, 338, 338 },
            {  292, 267, 255, 236, 219, 195, 197, 210, 296, 296, 296, 296, 296, 348, 348, 348 },
            {  289, 264, 253, 232, 216, 195, 196, 207, 288, 288, 288, 288, 288, 353, 353, 353 },
            {  284, 259, 248, 227, 211, 193, 194, 203, 279, 279, 279, 279, 279, 350, 350, 350 },
            {  278, 253, 242, 220, 205, 190, 190, 197, 270, 270, 270, 270, 270, 343, 343, 343 },
            {  271, 246, 234, 211, 198, 185, 185, 191, 260, 260, 260, 260, 260, 330, 330, 330 },
            {  263, 238, 224, 202, 190, 180, 179, 184, 249, 249, 249, 249, 249, 313, 313, 313 },
            {  255, 230, 214, 192, 182, 174, 173, 177, 239, 239, 239, 239, 239, 287, 287, 287 },
            {  247, 221, 204, 183, 174, 169, 167, 170, 228, 228, 228, 228, 228, 254, 254, 254 },
            {  239, 213, 194, 173, 166, 163, 161, 163, 217, 217, 217, 217, 217, 219, 219, 219 },
            {  231, 205, 185, 164, 158, 158, 156, 156, 207, 207, 207, 207, 207, 186, 186, 186 }
        },
        /* au16EdgeStr     */
        /* ISO */
        /* 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400, 204800, 409600, 819200,1638400,3276800 */
        {   {  233, 256, 281, 288, 301, 276, 231, 212, 259, 224, 224, 224, 224, 224, 224, 224 },
            {  239, 259, 283, 296, 305, 281, 243, 218, 269, 244, 244, 244, 244, 244, 244, 244 },
            {  245, 263, 286, 304, 311, 289, 256, 225, 279, 265, 265, 265, 265, 265, 265, 265 },
            {  252, 268, 290, 313, 317, 299, 269, 235, 288, 285, 285, 285, 285, 285, 285, 285 },
            {  258, 273, 293, 321, 324, 308, 281, 245, 298, 303, 303, 303, 303, 303, 303, 303 },
            {  264, 278, 297, 328, 331, 318, 293, 255, 308, 319, 319, 319, 319, 319, 319, 319 },
            {  269, 282, 300, 335, 337, 327, 303, 265, 317, 333, 333, 333, 333, 333, 333, 333 },
            {  273, 285, 303, 340, 341, 333, 312, 273, 325, 346, 346, 346, 346, 346, 346, 346 },
            {  276, 287, 304, 343, 344, 337, 318, 280, 332, 357, 357, 357, 357, 357, 357, 357 },
            {  279, 288, 306, 346, 345, 341, 324, 287, 339, 364, 364, 364, 364, 364, 364, 364 },
            {  281, 290, 307, 347, 347, 344, 328, 294, 345, 370, 370, 370, 370, 370, 370, 370 },
            {  282, 290, 308, 348, 348, 346, 332, 301, 351, 374, 374, 374, 374, 374, 374, 374 },
            {  284, 291, 308, 348, 348, 347, 335, 308, 356, 379, 379, 379, 379, 379, 379, 379 },
            {  285, 291, 309, 348, 348, 348, 337, 313, 361, 384, 384, 384, 384, 384, 384, 384 },
            {  285, 291, 309, 348, 348, 349, 339, 318, 365, 390, 390, 390, 390, 390, 390, 390 },
            {  285, 291, 309, 348, 348, 349, 340, 321, 368, 394, 394, 394, 394, 394, 394, 394 },
            {  285, 291, 309, 348, 348, 349, 340, 323, 370, 398, 398, 398, 398, 398, 398, 398 },
            {  284, 290, 308, 347, 347, 348, 340, 324, 371, 398, 398, 398, 398, 398, 398, 398 },
            {  282, 289, 307, 346, 346, 346, 338, 324, 371, 398, 398, 398, 398, 398, 398, 398 },
            {  280, 288, 306, 345, 345, 344, 336, 323, 370, 398, 398, 398, 398, 398, 398, 398 },
            {  278, 287, 304, 344, 344, 341, 333, 321, 369, 398, 398, 398, 398, 398, 398, 398 },
            {  276, 286, 303, 342, 342, 338, 330, 318, 367, 398, 398, 398, 398, 398, 398, 398 },
            {  273, 284, 301, 339, 340, 335, 327, 315, 364, 399, 399, 399, 399, 399, 399, 399 },
            {  271, 283, 299, 336, 337, 331, 323, 312, 361, 402, 402, 402, 402, 402, 402, 402 },
            {  268, 281, 297, 332, 334, 326, 318, 308, 357, 405, 405, 405, 405, 405, 405, 405 },
            {  265, 280, 294, 327, 330, 320, 313, 302, 351, 408, 408, 408, 408, 408, 408, 408 },
            {  262, 278, 291, 322, 326, 313, 306, 295, 345, 411, 411, 411, 411, 411, 411, 411 },
            {  258, 276, 288, 316, 322, 306, 300, 287, 337, 413, 413, 413, 413, 413, 413, 413 },
            {  254, 274, 285, 310, 317, 299, 293, 280, 330, 411, 411, 411, 411, 411, 411, 411 },
            {  251, 272, 281, 304, 313, 293, 287, 273, 322, 408, 408, 408, 408, 408, 408, 408 },
            {  249, 270, 278, 299, 308, 288, 282, 268, 315, 405, 405, 405, 405, 405, 405, 405 },
            {  247, 269, 275, 293, 304, 284, 279, 264, 308, 402, 402, 402, 402, 402, 402, 402 }
        },
        /* au16TextureFreq */
        /* ISO */
        /* 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400, 204800, 409600, 819200,1638400,3276800 */
        {  170, 180, 190, 200, 200, 200, 180, 170, 170, 170, 170, 160, 160, 160, 160, 160 },

        /* au16EdgeFreq */
        {  120, 120, 110, 100, 100, 100, 200, 200, 100, 100,  96,  96,  96,  96,  96,  96 },

        /* au8OverShoot */
        {   40,  46,  52,  54,  54,  50,  45,  40,  30,  30,  40,  40,  10,  10,  10,  10 },

        /* au8UnderShoot */
        {   75,  78,  80,  75,  75,  70,  60,  60,  50,  50,  50,  50,  15,  15,  15,  15 },

        /* au16shootSupStr */
        {    5,   5,   5,   5,   5,   5,   5,   5,   4,   3,   2,   1,   0,   0,   0,   0 },

        /* au8ShootSupAdj */
        {    6,   6,   6,   6,   6,   6,   5,   5,   5,   4,   3,   2,   1,   0,   0,   0 },

        /* au8DetailCtrl */
        {  128, 128, 128, 128, 128, 128, 128, 120, 118, 118, 110, 120, 120, 120, 120, 120 },

        /* au8DetailCtrlThr */
        {  160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160 },

        /* au8EdgeFiltStr */
        {   50,  50,  50,  55,  57,  60,  61,  62,  62,  62,  62,  62,  62,  62,  62,  62 },

        /* au8EdgeFiltMaxCap[ISP_AUTO_ISO_STRENGTH_NUM] */
        {   18,  18,  18,  20,  22,  24,  22,  18,  18,  18,  18,  18,  18,  18,  18,  18 },

        /* au8RGain[ISP_AUTO_ISO_STRENGTH_NUM] */
        {   30,  30,  30,  24,  16,  16,  16,  31,  31,  31,  31,  31,  31,  31,  31,  31 },

        /* au8GGain */
        {   31,  32,  45,  56,  64,  64,  64,  48,  31,  31,  31,  31,  31,  31,  31,  31 },

        /* au8BGain */
        {   30,  30,  30,  24,  16,  16,  16,  31,  31,  31,  31,  31,  31,  31,  31,  31 },

        /* au8SkinGain */
        {   16,  24,  28,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31 },

        /* u8MaxSharpGain */
        {   72,  72,  72,  74,  80,  80,  80,  80,  80,  80,  80,  80,  80,  80,  80,  80 },
        /* au8WeakDetailGain */
        {    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 }
    },
};

static AWB_CCM_S g_stAwbCcm = {
    4,
    {
        {
            6150,
            {
                569, 33198, 117, 32838, 328, 32770, 0, 33019, 507
            },
        },
        {
            4850,
            {
                606, 33210, 92, 32837, 331, 32774, 32769, 33085, 574
            },
        },
        {
            3650,
            {
                523, 33069, 34, 32879, 392, 32793, 32785, 33014, 519
            },
        },
        {
            2650,
            {
                594, 33130, 24, 32892, 353, 27, 32803, 33246, 769
            },
        },
    },
};

static AWB_AGC_TABLE_S g_stAwbAgcTable = {
    /* bvalid */
    1,
    /* saturation */
    /*  1,    2,    4,    8,   16,   32,   64,  128,  256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 110, 110, 108, 108, 105, 100, 95, 95, 90, 90, 90, 80, 80, 80, 80, 80}
};

static AWB_AGC_TABLE_S g_stAwbAgcTableIr = {
    /* bvalid */
    1,

    /* saturation */
    /*  1,    2,    4,    8,   16,   32,   64,  128,  256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0 }
};

static const ISP_CMOS_WDR_S g_stIspWDR = {
    /* bFusionMode */
    0,

    /* bMotionComp */
    1,

    /* u16ShortThr */
    4032,

    /* u16LongThr */
    3008,

    /* bForceLong */
    1,

    /* u16ForceLongLowThr */
    500,

    /* u16ForceLongHigThr */
    700,

    /* bShortExpoChk */
    0,

    /* u16ShortCheckThd */
    0x8,

    /* au8MdThrLowGain[16] */
    /* 1,    2,    4,    8,   16,   32,   64,  128,  256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 64,   64,   64,   64,  128,  255,  255,  255,  255,  255,  255,  255,  255,  255,   255,   255},

    /* au8MdThrHigGain[16] */
    {128,  128,  128,  128,  128,  255,  255,  255,  255,  255,  255,  255,  255,  255,   255,   255},

    /* au16FusionThr[2] */
    {3855, 3000},

    /* u8MdtStillThd */
    0x14,

    /* u8MdtLongBlend */
    0x0
};

static const ISP_CMOS_DEHAZE_S g_stIspDehaze = {
    /* bEnable */
    0,
    /* bUserLutEnable */
    1,
    /* enOpType */
    0,
    /* u8AutoStrength */
    80,
    /* u8ManualStrength */
    128
};

static const ISP_CMOS_DEHAZE_S g_stIspDehazeIr = {
    /* bEnable */
    1,
    /* bUserLutEnable */
    1,
    /* enOpType */
    0,
    /* u8AutoStrength */
    100,
    /* u8ManualStrength */
    128
};

#define DRC_INIT_STR_NA 420, 380, 360, 320, 300, 280, 260, 240
#define DRC_INIT_STR_IR 320, 300, 260, 240, 220, 220, 220, 200
static ISP_CMOS_DRC_S g_stIspDRC = {
    /* bEnable */
    1,
    /* enOpType */
    1,
    /* u16ManualStrength */
    400,
    /* u16AutoStrength */
    512,
    /* u8SpatialFltCoef */
    1,
    /* u8RangeFltCoef */
    2,
    /* u8ContrastControl */
    10,
    /* s8DetailAdjustFactor */
    12,
    /* u8RangeAdaMax */
    8,
    /* u8FltScaleFine */
    6,
    /* u8FltScaleCoarse */
    6,
    /* u8GradRevMax */
    64,
    /* u8GradRevThr */
    50,
    /* u8BrightGainLmt */
    12,
    /* u8BrightGainLmtStep */
    8,
    /* u8DarkGainLmtY */
    80,
    /* u8DarkGainLmtC */
    0,
    /* u8PDStrength */
    35,
    /* u8LocalMixingBrightMax */
    32,
    /* u8LocalMixingBrightMin */
    20,
    /* u8LocalMixingBrightThr */
    96,
    /* s8LocalMixingBrightSlo */
    -3,
    /* u8LocalMixingDarkMax */
    32,
    /* u8LocalMixingDarkMin */
    28,
    /* u8LocalMixingDarkThr */
    200,
    /* s8LocalMixingDarkSlo */
    5,
    /* ColorCorrectionLut[33] */
    { 884,  906,  929,  950,  969,  985,  999,  1010, 1019, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
      1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 },
    /* ToneMappingValue[200] */
    {   8, 8, 16, 24, 31, 39, 48, 56, 65, 75, 85, 95, 106, 118, 130, 143, 156, 170, 185, 201, 218, 235, 254, 274, 294,
        316, 339, 364, 390, 417, 446, 477, 509, 543, 579, 617, 658, 701, 746, 794, 844, 898, 955, 1015, 1078, 1145,
        1216, 1291, 1370, 1454, 1543, 1637, 1736, 1841, 1952, 2069, 2194, 2325, 2465, 2612, 2767, 2932, 3106, 3290,
        3485, 3691, 3909, 4140, 4384, 4641, 4914, 5202, 5507, 5830, 6171, 6531, 6913, 7316, 7742, 8193, 8669, 9173,
        9705, 10268, 10863, 11492, 12145, 12808, 13483, 14171, 14872, 15587, 16319, 17069, 17840, 18635, 19458, 19881,
        20313, 20754, 21204, 21661, 22122, 22586, 23053, 23525, 24000, 24480, 24965, 25455, 25950, 26451, 26959, 27473,
        27995, 28524, 29062, 29609, 30165, 30732, 31309, 31899, 32501, 33116, 33746, 34391, 35043, 35706, 36381, 37066,
        37763, 38472, 39192, 39925, 40671, 41429, 42201, 42591, 42986, 43383, 43784, 44189, 44597, 45008, 45424, 45842,
        46265, 46691, 47121, 47555, 47993, 48434, 48880, 49329, 49783, 50241, 50703, 51169, 51639, 52113, 52592, 53075,
        53564, 54056, 54552, 55054, 55560, 56071, 56586, 56846, 57107, 57369, 57632, 57896, 58162, 58429, 58697, 58967,
        59238, 59510, 59783, 60057, 60333, 60611, 60889, 61169, 61451, 61733, 62017, 62303, 62589, 62877, 63167, 63458,
        63750, 64044, 64340, 64636, 64934, 65234 },
    /* u8Asymmetry */
    5,
    /* u8SecondPole */
    150,
    /* u8Stretch */
    50,
    /* u8Compress */
    150,
    /* u8CurveSel */
    0,
    /* au16Xpoint */
    {0, 200, 400, 600, 1000},
    /* au16Ypoint */
    {0, 200, 400, 600, 1000},
    /* au16Slope */
    {1000, 1000, 1000, 1000, 1000}
};

static const ISP_CMOS_CA_S g_stIspCA = {
    /* CA */
    1,
    /* Y */
    {   918,  919,  920,  922,  923,  925,  927,  929,  931,  933,  935,  938,  940,  942,  945,  947,
        950,  952,  955,  957,  960,  962,  965,  967,  969,  972,  974,  976,  978,  980,  981,  983,
        984,  986,  987,  988,  990,  991,  992,  993,  994,  995,  996,  997,  998,  999, 1000, 1001,
        1002, 1003, 1003, 1004, 1005, 1006, 1006, 1007, 1008, 1008, 1009, 1010, 1010, 1011, 1011, 1012,
        1013, 1013, 1014, 1014, 1014, 1015, 1015, 1015, 1016, 1016, 1016, 1016, 1017, 1017, 1017, 1017,
        1017, 1017, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1019, 1019, 1019, 1019,
        1019, 1019, 1019, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1021, 1021, 1021, 1021, 1021,
        1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1022, 1022, 1022, 1023, 1024, 1024, 1024, 1024 },
    /* ISO */
    /*  1,    2,    4,    8,   16,   32,   64,  128,  256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    {1024, 1024, 1100, 1100, 1100, 1100, 1050, 1000, 1000, 1000, 900, 800, 800, 800, 800, 800}
};


static const ISP_CMOS_LSC_S g_stCmosLsc = {
    /* MeshStrength */
    256,
    /* MeshScale */
    4,
    /* ISP_LSC_CABLI_TABLE_S */
    {
        {
            /* Rgain */
            {
                0x26b, 0x1de, 0x179, 0x12a, 0xee,  0xc4,  0xa2,  0x94,  0x94,  0x97,  0xad,  0xc8,  0x10d, 0x133, 0x184,
                0x1fd, 0x284, 0x235, 0x1ba, 0x158, 0x10d, 0xd3,  0xad,  0x8c,  0x7b,  0x74,  0x7b,  0x90,  0xaf,  0xd8,
                0x114, 0x164, 0x1d1, 0x253, 0x210, 0x194, 0x136, 0xec,  0xbc,  0x91,  0x6f,  0x5d,  0x59,  0x5f,  0x75,
                0x94,  0xbf,  0xf7,  0x149, 0x1ac, 0x229, 0x1e1, 0x177, 0x11a, 0xd7,  0xa6,  0x7c,  0x5b,  0x44,  0x3e,
                0x4a,  0x5c,  0x7d,  0xab,  0xe2,  0x127, 0x18f, 0x200, 0x1c8, 0x15f, 0x10d, 0xc9,  0x98,  0x69,  0x4a,
                0x32,  0x2a,  0x33,  0x4a,  0x6b,  0x9e,  0xd0,  0x113, 0x175, 0x1e5, 0x1b6, 0x14f, 0xf9,  0xbf,  0x84,
                0x57,  0x34,  0x21,  0x18,  0x21,  0x3a,  0x5e,  0x8e,  0xc2,  0x105, 0x162, 0x1d8, 0x1a9, 0x140, 0xef,
                0xb4,  0x7d,  0x50,  0x2d,  0x11,  0xa,   0x15,  0x2f,  0x57,  0x83,  0xb9,  0xfb,  0x156, 0x1c3, 0x1a5,
                0x134, 0xe9,  0xae,  0x7a,  0x4b,  0x26,  0x8,   0x4,   0xc,   0x28,  0x4f,  0x7f,  0xb8,  0xf7,  0x151,
                0x1bf, 0x19d, 0x134, 0xe8,  0xac,  0x75,  0x48,  0x34,  0x4,   0x0,   0xa,   0x25,  0x50,  0x7e,  0xb5,
                0xf8,  0x150, 0x1bd, 0x199, 0x134, 0xea,  0xae,  0x73,  0x4b,  0x32,  0x5,   0x2,   0xd,   0x2a,  0x4e,
                0x83,  0xbc,  0xf9,  0x151, 0x1c0, 0x1a5, 0x139, 0xee,  0xb1,  0x7e,  0x51,  0x2f,  0x14,  0xd,   0x16,
                0x31,  0x56,  0x86,  0xbb,  0x100, 0x158, 0x1c3, 0x1b2, 0x147, 0xfe,  0xbd,  0x87,  0x5f,  0x3b,  0x24,
                0x1b,  0x24,  0x43,  0x64,  0x90,  0xc8,  0x107, 0x164, 0x1d2, 0x1c1, 0x159, 0x107, 0xca,  0x94,  0x6e,
                0x4d,  0x36,  0x30,  0x36,  0x4e,  0x74,  0x9b,  0xd1,  0x11a, 0x173, 0x1e2, 0x1de, 0x16f, 0x119, 0xda,
                0xa7,  0x7f,  0x64,  0x4e,  0x45,  0x4f,  0x62,  0x86,  0xb1,  0xe6,  0x128, 0x188, 0x1fd, 0x1f9, 0x18a,
                0x131, 0xf2,  0xbf,  0x99,  0x79,  0x65,  0x60,  0x6a,  0x7b,  0x9e,  0xc9,  0xfb,  0x13d, 0x19f, 0x21e,
                0x21c, 0x1a9, 0x14b, 0x109, 0xd6,  0xb4,  0x96,  0x83,  0x7f,  0x83,  0x94,  0xb7,  0xe0,  0x115, 0x15d,
                0x1c1, 0x23f, 0x244, 0x1c8, 0x167, 0x127, 0xf5,  0xcc,  0xb1,  0x9f,  0x99,  0x98,  0xb3,  0xce,  0xf7,
                0x12e, 0x17a, 0x1e9, 0x262,
            },

            /* Grgain */
            {
                0x27c, 0x1fd, 0x18b, 0x138, 0xfb,  0xd2,  0xb1,  0xa3,  0x9d,  0xa0,  0xb7,  0xd8,  0x11d, 0x141, 0x1a4,
                0x21c, 0x2ab, 0x24a, 0x1d0, 0x164, 0x113, 0xde,  0xb4,  0x96,  0x83,  0x7e,  0x84,  0x9a,  0xbb,  0xe8,
                0x128, 0x17a, 0x1ec, 0x274, 0x21c, 0x1a8, 0x140, 0xf8,  0xc5,  0x9b,  0x77,  0x64,  0x5d,  0x67,  0x80,
                0x9f,  0xca,  0x105, 0x15a, 0x1c1, 0x24e, 0x1f6, 0x18b, 0x127, 0xe6,  0xaf,  0x82,  0x62,  0x4b,  0x46,
                0x4e,  0x64,  0x85,  0xb6,  0xee,  0x13c, 0x1a6, 0x22d, 0x1de, 0x170, 0x118, 0xd3,  0x9d,  0x6f,  0x4c,
                0x35,  0x2a,  0x37,  0x4f,  0x76,  0xa3,  0xdb,  0x123, 0x187, 0x20b, 0x1ca, 0x15c, 0x107, 0xc6,  0x8e,
                0x5d,  0x3c,  0x21,  0x19,  0x27,  0x41,  0x68,  0x94,  0xce,  0x116, 0x17a, 0x1fa, 0x1b4, 0x151, 0xfc,
                0xbd,  0x85,  0x54,  0x31,  0x12,  0x9,   0x16,  0x34,  0x5c,  0x89,  0xc6,  0x10a, 0x16b, 0x1e5, 0x1ae,
                0x147, 0xf7,  0xb7,  0x80,  0x53,  0x29,  0xa,   0x4,   0x12,  0x2c,  0x56,  0x86,  0xc1,  0x103, 0x166,
                0x1dc, 0x1ac, 0x144, 0xf5,  0xb5,  0x7d,  0x4c,  0x37,  0x7,   0x1,   0xc,   0x2a,  0x55,  0x83,  0xbe,
                0x101, 0x166, 0x1d7, 0x1aa, 0x145, 0xf9,  0xb6,  0x82,  0x52,  0x3a,  0xb,   0x5,   0xd,   0x2d,  0x57,
                0x88,  0xc0,  0x102, 0x162, 0x1dc, 0x1b4, 0x14d, 0xfe,  0xbc,  0x87,  0x5c,  0x36,  0x16,  0xf,   0x19,
                0x36,  0x5f,  0x8f,  0xca,  0x10d, 0x16b, 0x1e2, 0x1be, 0x15a, 0x10b, 0xca,  0x90,  0x63,  0x3e,  0x26,
                0x1f,  0x2b,  0x44,  0x69,  0x9c,  0xd2,  0x119, 0x175, 0x1f3, 0x1c9, 0x16a, 0x114, 0xd5,  0x9e,  0x77,
                0x54,  0x3a,  0x33,  0x3a,  0x54,  0x79,  0xa8,  0xe1,  0x127, 0x184, 0x203, 0x1ed, 0x186, 0x12a, 0xe7,
                0xb1,  0x87,  0x6a,  0x55,  0x4c,  0x54,  0x6d,  0x8f,  0xbb,  0xf4,  0x137, 0x1a0, 0x21a, 0x20d, 0x1a0,
                0x140, 0xfc,  0xc7,  0xa3,  0x81,  0x6d,  0x66,  0x71,  0x85,  0xa5,  0xd3,  0x108, 0x152, 0x1b9, 0x23c,
                0x231, 0x1bf, 0x160, 0x119, 0xe6,  0xbd,  0x9e,  0x8a,  0x84,  0x8c,  0xa2,  0xc5,  0xf0,  0x123, 0x16d,
                0x1da, 0x260, 0x25c, 0x1e1, 0x17f, 0x136, 0xfd,  0xda,  0xbe,  0xaa,  0x9f,  0xa9,  0xbb,  0xda,  0x104,
                0x13e, 0x18e, 0x1ff, 0x285,
            },

            /* Gbgain */
            {
                0x28b, 0x1fd, 0x18e, 0x139, 0xfd,  0xd7,  0xb6,  0xa3,  0xa4,  0xa9,  0xbc,  0xde,  0x126, 0x14d, 0x1a5,
                0x21f, 0x2b1, 0x256, 0x1d6, 0x16a, 0x11d, 0xe4,  0xb9,  0x9b,  0x87,  0x83,  0x8b,  0xa0,  0xc1,  0xec,
                0x12e, 0x183, 0x1f5, 0x284, 0x229, 0x1ad, 0x142, 0xfb,  0xc9,  0x9f,  0x7c,  0x6a,  0x62,  0x6c,  0x84,
                0xa4,  0xd2,  0x10f, 0x15f, 0x1ce, 0x252, 0x201, 0x18a, 0x129, 0xe8,  0xb1,  0x86,  0x67,  0x4d,  0x4b,
                0x51,  0x6a,  0x8b,  0xbc,  0xf9,  0x140, 0x1ac, 0x229, 0x1ea, 0x176, 0x116, 0xd2,  0x9e,  0x73,  0x4e,
                0x38,  0x2f,  0x3c,  0x54,  0x7a,  0xaa,  0xe0,  0x127, 0x18f, 0x211, 0x1ce, 0x160, 0x107, 0xc8,  0x94,
                0x5f,  0x3d,  0x22,  0x1e,  0x28,  0x43,  0x6b,  0x9a,  0xd1,  0x11c, 0x17d, 0x1fa, 0x1bf, 0x153, 0x101,
                0xbe,  0x86,  0x54,  0x2f,  0x14,  0xc,   0x1b,  0x36,  0x60,  0x91,  0xc9,  0x110, 0x16f, 0x1eb, 0x1bf,
                0x14a, 0xfa,  0xb8,  0x81,  0x4f,  0x28,  0xb,   0x3,   0x11,  0x2e,  0x56,  0x8a,  0xc6,  0x10a, 0x16a,
                0x1e2, 0x1b1, 0x149, 0xfa,  0xb8,  0x7f,  0x50,  0x37,  0x8,   0x0,   0xf,   0x2e,  0x57,  0x89,  0xc2,
                0x107, 0x16a, 0x1df, 0x1b9, 0x148, 0xf9,  0xba,  0x82,  0x54,  0x36,  0xd,   0x5,   0x10,  0x2f,  0x5a,
                0x8b,  0xc5,  0x10a, 0x167, 0x1dd, 0x1c0, 0x150, 0x100, 0xbf,  0x86,  0x5a,  0x34,  0x16,  0x10,  0x18,
                0x39,  0x61,  0x91,  0xcb,  0x115, 0x171, 0x1e9, 0x1d0, 0x15d, 0x10b, 0xc9,  0x93,  0x66,  0x43,  0x26,
                0x1f,  0x29,  0x46,  0x6d,  0x9f,  0xd4,  0x11a, 0x17d, 0x1f3, 0x1e1, 0x16e, 0x11a, 0xd6,  0x9d,  0x76,
                0x54,  0x3c,  0x35,  0x40,  0x59,  0x7b,  0xad,  0xe4,  0x128, 0x187, 0x20a, 0x200, 0x184, 0x12c, 0xe8,
                0xb3,  0x87,  0x66,  0x51,  0x4d,  0x55,  0x6d,  0x93,  0xbd,  0xf9,  0x13f, 0x1a2, 0x21d, 0x214, 0x1a4,
                0x145, 0xfd,  0xc7,  0x9f,  0x82,  0x6d,  0x66,  0x6d,  0x86,  0xa8,  0xd7,  0x10c, 0x155, 0x1bd, 0x246,
                0x242, 0x1c2, 0x161, 0x119, 0xe4,  0xb9,  0x9d,  0x8f,  0x83,  0x8d,  0xa3,  0xc4,  0xf1,  0x12a, 0x174,
                0x1e1, 0x26b, 0x261, 0x1de, 0x17f, 0x131, 0xfd,  0xd8,  0xbc,  0xac,  0x9d,  0xa9,  0xbe,  0xe0,  0x109,
                0x142, 0x193, 0x208, 0x28f,
            },

            /* Bgain */
            {
                0x28e, 0x202, 0x186, 0x12f, 0xfb,  0xcc,  0xb4,  0xa4,  0xa4,  0xa9,  0xba,  0xe2,  0x120, 0x14b, 0x1a5,
                0x220, 0x2b6, 0x251, 0x1d8, 0x16e, 0x114, 0xde,  0xb3,  0x92,  0x83,  0x81,  0x88,  0xa1,  0xbe,  0xec,
                0x128, 0x17d, 0x1f1, 0x274, 0x228, 0x1ac, 0x144, 0xfc,  0xc2,  0x97,  0x7c,  0x67,  0x61,  0x67,  0x7e,
                0x9e,  0xcf,  0x107, 0x155, 0x1c9, 0x252, 0x1fa, 0x183, 0x12a, 0xe4,  0xb0,  0x83,  0x61,  0x4d,  0x48,
                0x50,  0x67,  0x86,  0xb4,  0xec,  0x133, 0x1a4, 0x22c, 0x1da, 0x16d, 0x113, 0xcd,  0x9f,  0x70,  0x4e,
                0x3a,  0x2f,  0x3c,  0x51,  0x75,  0xa0,  0xdb,  0x11e, 0x185, 0x201, 0x1c5, 0x15d, 0x101, 0xc5,  0x8b,
                0x5b,  0x41,  0x24,  0x1e,  0x27,  0x3d,  0x65,  0x93,  0xce,  0x114, 0x179, 0x1fc, 0x1bc, 0x150, 0xfb,
                0xbe,  0x87,  0x57,  0x30,  0x17,  0xd,   0x18,  0x37,  0x5f,  0x8b,  0xbf,  0x105, 0x16b, 0x1e9, 0x1ac,
                0x147, 0xf1,  0xb8,  0x80,  0x4f,  0x29,  0xf,   0x5,   0x10,  0x32,  0x5c,  0x88,  0xc2,  0x107, 0x160,
                0x1d4, 0x1af, 0x143, 0xf7,  0xb4,  0x7d,  0x4f,  0x3a,  0x7,   0x1,   0xc,   0x2f,  0x57,  0x8b,  0xc0,
                0x102, 0x15f, 0x1d8, 0x1a8, 0x147, 0xf5,  0xb6,  0x80,  0x51,  0x37,  0xc,   0x5,   0x10,  0x2f,  0x5a,
                0x8b,  0xc8,  0x108, 0x163, 0x1da, 0x1bc, 0x151, 0xfb,  0xba,  0x8a,  0x59,  0x36,  0x15,  0xf,   0x1b,
                0x38,  0x62,  0x92,  0xc9,  0x10e, 0x171, 0x1ec, 0x1cd, 0x156, 0x105, 0xc6,  0x8c,  0x66,  0x45,  0x27,
                0x23,  0x27,  0x47,  0x6f,  0x9a,  0xd8,  0x115, 0x17e, 0x1ee, 0x1da, 0x16c, 0x110, 0xd2,  0x9e,  0x78,
                0x54,  0x3d,  0x38,  0x3e,  0x58,  0x78,  0xad,  0xe3,  0x126, 0x186, 0x20d, 0x201, 0x18e, 0x12b, 0xe2,
                0xb1,  0x87,  0x67,  0x54,  0x51,  0x58,  0x6c,  0x93,  0xb8,  0xf4,  0x13b, 0x1a3, 0x229, 0x217, 0x1aa,
                0x147, 0x100, 0xc8,  0xa0,  0x82,  0x6c,  0x66,  0x6c,  0x86,  0xa9,  0xd0,  0x107, 0x156, 0x1bb, 0x23b,
                0x232, 0x1c2, 0x165, 0x117, 0xe4,  0xbf,  0xa2,  0x8c,  0x85,  0x8a,  0x9f,  0xc1,  0xeb,  0x126, 0x16b,
                0x1dd, 0x26c, 0x262, 0x1ea, 0x17c, 0x132, 0xf7,  0xd2,  0xc0,  0xa9,  0x9f,  0xa5,  0xb9,  0xd3,  0x102,
                0x137, 0x184, 0x206, 0x289,
            },
        },

        {
            /* Rgain */
            {
                0x399, 0x2df, 0x23e, 0x1cd, 0x170, 0x135, 0xfc,  0xdb,  0xda,  0xe4,  0xfd,  0x12f, 0x16e, 0x1d4, 0x24e,
                0x2ee, 0x3e2, 0x372, 0x2b0, 0x20f, 0x19a, 0x140, 0x109, 0xdc,  0xb7,  0xaf,  0xbe,  0xd5,  0x105, 0x14c,
                0x1a4, 0x225, 0x2b8, 0x384, 0x32a, 0x276, 0x1e3, 0x174, 0x11c, 0xda,  0xaf,  0x92,  0x88,  0x97,  0xac,
                0xec,  0x125, 0x180, 0x200, 0x289, 0x34f, 0x2f6, 0x24f, 0x1bd, 0x14b, 0xfd,  0xba,  0x89,  0x6c,  0x61,
                0x71,  0x89,  0xc6,  0x107, 0x15a, 0x1c7, 0x262, 0x319, 0x2c9, 0x229, 0x1a5, 0x135, 0xdb,  0x9b,  0x6a,
                0x4a,  0x3f,  0x4e,  0x6c,  0xa5,  0xeb,  0x13e, 0x1b1, 0x23d, 0x2e3, 0x2b9, 0x211, 0x187, 0x11b, 0xc9,
                0x81,  0x4d,  0x2b,  0x21,  0x2f,  0x58,  0x8f,  0xda,  0x12a, 0x196, 0x229, 0x2c8, 0x29c, 0x1fb, 0x16e,
                0x10d, 0xb5,  0x6e,  0x37,  0x11,  0x7,   0x1a,  0x46,  0x7b,  0xc3,  0x118, 0x187, 0x210, 0x2b7, 0x2bc,
                0x1f5, 0x16b, 0x106, 0xb1,  0x61,  0x2e,  0x4,   0x0,   0xe,   0x3a,  0x71,  0xba,  0x113, 0x17f, 0x206,
                0x2a4, 0x33a, 0x1f3, 0x165, 0xfd,  0xab,  0x62,  0x2d,  0x2,   0x3,   0x8,   0x35,  0x6e,  0xb6,  0x10f,
                0x179, 0x202, 0x29f, 0x2f0, 0x1e6, 0x165, 0x103, 0xac,  0x63,  0x30,  0x7,   0x1,   0xb,   0x36,  0x70,
                0xb8,  0x112, 0x176, 0x208, 0x2a4, 0x2d2, 0x1f4, 0x171, 0x106, 0xb6,  0x70,  0x38,  0x15,  0xa,   0x18,
                0x40,  0x78,  0xbf,  0x11c, 0x181, 0x20c, 0x2ac, 0x2d0, 0x202, 0x17e, 0x118, 0xc0,  0x7c,  0x4a,  0x2e,
                0x1d,  0x2e,  0x4f,  0x87,  0xcd,  0x122, 0x190, 0x21a, 0x2bb, 0x2be, 0x216, 0x194, 0x12d, 0xd9,  0x99,
                0x64,  0x49,  0x3d,  0x48,  0x68,  0x9d,  0xdd,  0x13f, 0x1a3, 0x229, 0x2cf, 0x2e4, 0x236, 0x1bb, 0x144,
                0xf0,  0xb5,  0x81,  0x63,  0x62,  0x66,  0x86,  0xb7,  0xfb,  0x14e, 0x1be, 0x249, 0x2ed, 0x30c, 0x26c,
                0x1ce, 0x164, 0x110, 0xd4,  0xa4,  0x86,  0x7f,  0x86,  0xa6,  0xd7,  0x115, 0x171, 0x1da, 0x270, 0x31c,
                0x339, 0x28d, 0x1fb, 0x18d, 0x133, 0xf6,  0xc5,  0xaa,  0xa1,  0xae,  0xca,  0xf8,  0x138, 0x195, 0x210,
                0x2a1, 0x355, 0x37f, 0x2be, 0x229, 0x1b1, 0x159, 0x118, 0xeb,  0xd3,  0xc6,  0xd4,  0xed,  0x11f, 0x15d,
                0x1cd, 0x23d, 0x2cc, 0x388,
            },

            /* Grgain */
            {
                0x324, 0x279, 0x1f5, 0x191, 0x148, 0x113, 0xe4,  0xcd,  0xc9,  0xd4,  0xf2,  0x11f, 0x164, 0x1b6, 0x22c,
                0x2ba, 0x392, 0x2f1, 0x250, 0x1cb, 0x16c, 0x11f, 0xe9,  0xc2,  0xa8,  0xa5,  0xb1,  0xcf,  0xfa,  0x13d,
                0x193, 0x208, 0x28d, 0x349, 0x2b8, 0x225, 0x1a9, 0x148, 0xfa,  0xc5,  0x9c,  0x80,  0x7e,  0x8e,  0xa5,
                0xe3,  0x11b, 0x16e, 0x1e6, 0x266, 0x316, 0x28b, 0x201, 0x18e, 0x12a, 0xe4,  0xa5,  0x79,  0x60,  0x59,
                0x6a,  0x85,  0xbf,  0xfe,  0x151, 0x1b7, 0x243, 0x2e3, 0x26b, 0x1e5, 0x174, 0x111, 0xc4,  0x88,  0x5d,
                0x40,  0x39,  0x4a,  0x69,  0xa2,  0xea,  0x137, 0x19e, 0x223, 0x2b8, 0x253, 0x1cd, 0x159, 0xfc,  0xb2,
                0x73,  0x43,  0x26,  0x1e,  0x30,  0x57,  0x90,  0xd8,  0x124, 0x188, 0x211, 0x2a4, 0x247, 0x1bd, 0x14c,
                0xf2,  0xa4,  0x65,  0x31,  0x10,  0x6,   0x1a,  0x49,  0x7c,  0xc3,  0x116, 0x17a, 0x201, 0x292, 0x263,
                0x1b6, 0x141, 0xec,  0xa1,  0x5a,  0x26,  0x3,   0x1,   0xf,   0x3f,  0x74,  0xb9,  0x111, 0x172, 0x1f3,
                0x285, 0x2dc, 0x1b4, 0x13e, 0xe6,  0x98,  0x56,  0x25,  0x1,   0x5,   0xb,   0x38,  0x71,  0xb8,  0x10e,
                0x16f, 0x1ed, 0x281, 0x291, 0x1af, 0x142, 0xe5,  0x9d,  0x5a,  0x2b,  0x7,   0x2,   0xe,   0x3c,  0x74,
                0xbb,  0x10f, 0x170, 0x1f0, 0x27f, 0x28d, 0x1b7, 0x14b, 0xee,  0xa5,  0x64,  0x35,  0x13,  0xa,   0x1c,
                0x42,  0x7d,  0xbe,  0x116, 0x17b, 0x1f8, 0x28c, 0x27e, 0x1c3, 0x156, 0xfc,  0xb1,  0x76,  0x46,  0x2e,
                0x1f,  0x2f,  0x55,  0x8c,  0xd1,  0x127, 0x185, 0x207, 0x2a5, 0x265, 0x1d8, 0x169, 0x111, 0xc5,  0x8a,
                0x5c,  0x49,  0x3f,  0x4c,  0x6e,  0xa0,  0xe2,  0x13b, 0x199, 0x215, 0x2ac, 0x282, 0x1f2, 0x188, 0x125,
                0xde,  0xa5,  0x79,  0x5e,  0x63,  0x67,  0x89,  0xb8,  0xf8,  0x14c, 0x1ae, 0x231, 0x2cb, 0x2a6, 0x221,
                0x19c, 0x141, 0xfb,  0xc2,  0x9a,  0x82,  0x7d,  0x88,  0xa6,  0xd6,  0x114, 0x168, 0x1cd, 0x257, 0x2f4,
                0x2cd, 0x240, 0x1c2, 0x166, 0x11e, 0xe7,  0xbc,  0xa8,  0xa0,  0xac,  0xca,  0xf7,  0x138, 0x18a, 0x1f8,
                0x27d, 0x31d, 0x317, 0x268, 0x1ef, 0x189, 0x13b, 0x106, 0xde,  0xc9,  0xc3,  0xd3,  0xed,  0x119, 0x15a,
                0x1c1, 0x221, 0x2a9, 0x357,
            },

            /* Gbgain */
            {
                0x32b, 0x277, 0x1f2, 0x18f, 0x148, 0x116, 0xe3,  0xc9,  0xc9,  0xd5,  0xf1,  0x11c, 0x15a, 0x1b4, 0x22d,
                0x2bd, 0x38d, 0x2f4, 0x24d, 0x1ca, 0x16d, 0x11b, 0xea,  0xc4,  0xa8,  0xa3,  0xb3,  0xc9,  0xfb,  0x13d,
                0x190, 0x204, 0x28e, 0x348, 0x2b8, 0x221, 0x1a8, 0x149, 0xfe,  0xc5,  0x9b,  0x80,  0x7a,  0x8e,  0xa6,
                0xe2,  0x119, 0x16f, 0x1e4, 0x269, 0x315, 0x28e, 0x201, 0x18a, 0x12d, 0xe3,  0xa2,  0x78,  0x60,  0x58,
                0x6c,  0x86,  0xc0,  0xfc,  0x14e, 0x1b9, 0x242, 0x2e7, 0x270, 0x1e1, 0x178, 0x115, 0xc5,  0x8a,  0x5e,
                0x41,  0x3a,  0x4b,  0x6a,  0xa2,  0xe7,  0x136, 0x19e, 0x225, 0x2bd, 0x258, 0x1ce, 0x15c, 0xff,  0xb1,
                0x75,  0x44,  0x26,  0x1e,  0x30,  0x57,  0x8d,  0xd7,  0x125, 0x18c, 0x212, 0x2a7, 0x241, 0x1bd, 0x14f,
                0xf2,  0xa5,  0x65,  0x30,  0x11,  0x7,   0x1b,  0x48,  0x7d,  0xc3,  0x118, 0x17b, 0x1ff, 0x297, 0x26b,
                0x1ba, 0x147, 0xef,  0xa1,  0x5b,  0x28,  0x4,   0x1,   0x10,  0x3e,  0x75,  0xba,  0x112, 0x171, 0x1f4,
                0x28b, 0x2de, 0x1b6, 0x140, 0xe5,  0x98,  0x5a,  0x27,  0x1,   0x5,   0xb,   0x37,  0x71,  0xb8,  0x10f,
                0x171, 0x1f2, 0x27f, 0x293, 0x1b0, 0x144, 0xe6,  0x9c,  0x5a,  0x2c,  0x7,   0x4,   0xe,   0x39,  0x74,
                0xbc,  0x10f, 0x16e, 0x1f4, 0x282, 0x285, 0x1ba, 0x14b, 0xef,  0xa5,  0x66,  0x36,  0x15,  0xb,   0x1d,
                0x46,  0x7c,  0xc1,  0x117, 0x17c, 0x1f8, 0x293, 0x27c, 0x1c5, 0x159, 0xfd,  0xb1,  0x79,  0x47,  0x2e,
                0x1f,  0x33,  0x56,  0x8e,  0xce,  0x129, 0x187, 0x206, 0x295, 0x266, 0x1db, 0x16d, 0x111, 0xc6,  0x8d,
                0x5f,  0x49,  0x3f,  0x4a,  0x6f,  0xa3,  0xe1,  0x13a, 0x19c, 0x219, 0x2ac, 0x280, 0x1f4, 0x18a, 0x126,
                0xde,  0xa5,  0x7e,  0x61,  0x61,  0x67,  0x87,  0xbd,  0xf6,  0x14e, 0x1ae, 0x232, 0x2cb, 0x2ae, 0x21f,
                0x1a0, 0x141, 0xf8,  0xc4,  0x99,  0x84,  0x7f,  0x89,  0xa6,  0xd4,  0x115, 0x169, 0x1d1, 0x255, 0x2f2,
                0x2d4, 0x243, 0x1c6, 0x165, 0x11a, 0xe6,  0xc0,  0xa8,  0xa0,  0xaa,  0xca,  0xfc,  0x137, 0x18a, 0x1f9,
                0x282, 0x324, 0x310, 0x26a, 0x1f0, 0x18a, 0x13d, 0x108, 0xde,  0xca,  0xc3,  0xcf,  0xf0,  0x11d, 0x15b,
                0x1c1, 0x227, 0x2aa, 0x360,
            },

            /* Bgain */
            {
                0x2f0, 0x24a, 0x1d2, 0x175, 0x137, 0x105, 0xd7,  0xbd,  0xc0,  0xca,  0xec,  0x10f, 0x14b, 0x1a7, 0x21b,
                0x29c, 0x35e, 0x2b8, 0x228, 0x1ad, 0x155, 0x114, 0xe1,  0xbe,  0xa0,  0x9d,  0xad,  0xc1,  0xf3,  0x138,
                0x183, 0x1f5, 0x278, 0x325, 0x28f, 0x1fe, 0x18b, 0x138, 0xf1,  0xbc,  0x96,  0x7e,  0x78,  0x8a,  0xa2,
                0xda,  0x114, 0x162, 0x1d6, 0x253, 0x2f5, 0x25e, 0x1df, 0x171, 0x11b, 0xd7,  0x9f,  0x76,  0x5d,  0x5b,
                0x69,  0x84,  0xbd,  0xf9,  0x14a, 0x1ae, 0x232, 0x2c8, 0x249, 0x1c4, 0x15d, 0x105, 0xba,  0x83,  0x5a,
                0x3c,  0x37,  0x4c,  0x67,  0x9f,  0xe7,  0x12f, 0x195, 0x214, 0x2a1, 0x234, 0x1af, 0x141, 0xf0,  0xa8,
                0x71,  0x3e,  0x23,  0x1d,  0x30,  0x58,  0x91,  0xd3,  0x122, 0x180, 0x202, 0x287, 0x21e, 0x19d, 0x138,
                0xe3,  0x9d,  0x61,  0x2e,  0xf,   0x6,   0x1a,  0x47,  0x7c,  0xbf,  0x119, 0x171, 0x1f5, 0x279, 0x244,
                0x19f, 0x133, 0xdd,  0x97,  0x56,  0x28,  0x4,   0x1,   0x11,  0x3d,  0x77,  0xbc,  0x10f, 0x16f, 0x1e9,
                0x276, 0x2a9, 0x19e, 0x12e, 0xda,  0x92,  0x54,  0x24,  0x4,   0x7,   0xd,   0x3c,  0x75,  0xb4,  0x10b,
                0x168, 0x1e9, 0x271, 0x267, 0x192, 0x128, 0xd9,  0x96,  0x56,  0x2a,  0x6,   0x7,   0x10,  0x3d,  0x74,
                0xb6,  0x10c, 0x168, 0x1e4, 0x271, 0x263, 0x19a, 0x134, 0xdd,  0x9d,  0x65,  0x37,  0x16,  0xe,   0x1f,
                0x46,  0x79,  0xbd,  0x112, 0x170, 0x1ef, 0x286, 0x254, 0x1a5, 0x143, 0xf0,  0xa7,  0x70,  0x46,  0x2e,
                0x21,  0x33,  0x55,  0x90,  0xcb,  0x11d, 0x17d, 0x1f9, 0x287, 0x236, 0x1bd, 0x153, 0x100, 0xba,  0x84,
                0x57,  0x45,  0x42,  0x50,  0x6d,  0xa2,  0xde,  0x137, 0x194, 0x20a, 0x297, 0x25b, 0x1db, 0x175, 0x115,
                0xd2,  0x9b,  0x76,  0x5b,  0x5f,  0x69,  0x8a,  0xba,  0xf4,  0x149, 0x1a4, 0x226, 0x2bb, 0x27d, 0x1fb,
                0x186, 0x132, 0xef,  0xbc,  0x97,  0x81,  0x7d,  0x86,  0xa4,  0xd5,  0x112, 0x15e, 0x1bc, 0x242, 0x2da,
                0x2a9, 0x21f, 0x1aa, 0x151, 0x10e, 0xdc,  0xb7,  0xa3,  0x99,  0xaa,  0xc6,  0xee,  0x130, 0x183, 0x1f3,
                0x264, 0x304, 0x2d0, 0x245, 0x1da, 0x175, 0x12c, 0xf9,  0xdb,  0xc3,  0xbb,  0xc8,  0xe7,  0x114, 0x14d,
                0x1b2, 0x218, 0x29b, 0x338,
            },
        },
    },
};


#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */


#endif /* __SC500AI_CMOS_EX_H_ */

